import dayjs from "dayjs";

export const nextPage = (pageIndex: number, pageSize: number) => {
  return (pageIndex - 1) * pageSize;
};

export const formatDate = (date: number | Date) => {
  return dayjs(date).locale("zh-cn").format("YYYY年M月D日 HH:mm:ss");
};

export const addPx = (value: string, increment: number) => {
  // 提取数字部分
  const num = parseInt(value.replace("px", ""), 10);

  // 进行加法运算
  const newNum = num + increment;

  // 返回新的字符串
  return `${newNum}px`;
};
